using System;
using Tarkin.InfrastructureLibrary.Tests.Core.Basic.TestUtilities.ConcreteClasses;
using Tarkin.InfrastructureLibrary.Core.Basic;
using NUnit.Framework;

namespace Tarkin.InfrastructureLibrary.Tests.Core.Basic
{
    /// <summary>
    /// TypedElementTests is the NUnit TestFixture for the Tarkin.InfrastructureLibrary.Core.Basic.TypedElement class.
    /// </summary>
    [TestFixture]
    public class TypedElementTests
    {
        [Test]
        public void TestDefaultConstructor ()
        {
            ConcreteTypedElement typedElement = new ConcreteTypedElement ();

            Assert.IsNotNull ( typedElement );
        }

        [Test]
        public void TestOverloadedConstructorNameParameter ()
        {
            ConcreteTypedElement typedElement = new ConcreteTypedElement ( "Name" );

            Assert.IsNotNull ( typedElement );
            Assert.AreEqual ( "Name", typedElement.Name );
        }

        [Test]
        public void TestOverladedConstructorTypeParameter ()
        {
            ConcreteType type = new ConcreteType ( "Name" );
            ConcreteTypedElement typedElement = new ConcreteTypedElement ( type );

            Assert.IsNotNull ( typedElement );
            Assert.AreEqual ( "Name", typedElement.Type.Name );
        }

        [Test]
        public void TestOverloadedConstructorTwoParameters ()
        {
            ConcreteType type = new ConcreteType ( "Type name" );
            ConcreteTypedElement typedElement = new ConcreteTypedElement ( "Name", type );

            Assert.IsNotNull ( typedElement );
            Assert.AreEqual ( "Type name", typedElement.Type.Name );
            Assert.AreEqual ( "Name", typedElement.Name );
        }
    }
}
